package com.ml.mall.service.partner;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ml.mall.bean.base.ApiRestResult;
import com.ml.mall.bean.req.partner.*;
import com.ml.mall.bean.res.partner.PartnerQueryInfoRes;
import com.ml.mall.bean.res.partner.PartnerQueryRes;
import com.ml.mall.entity.company.SysCompany;
import org.springframework.stereotype.Component;

@Component
public interface SysPartnerService extends IService<SysCompany>{

    /**
     * @description    :合作商邀请商户
     * @author         :zxm
     * @date           :2021/5/19
    **/
    ApiRestResult partnerInviterMerchant(PartnerDto dto);

    /**
     * @description    :创建合作商
     * @author         :zxm
     * @date           :2021/5/19
    **/
    ApiRestResult createPartner(PartnerNewDto dto);

    /**
     * @description    :查询单个合作商
     * @author         :zxm
     * @date           :2021/5/19
    **/
    PartnerQueryInfoRes queryOnePartner(PartnerQueryOneDto dto);

    /**
     * @description    :分页查询合作商
     * @author         :zxm
     * @date           :2021/5/19
    **/
    IPage<SysCompany> queryPagePartner(PartnerQueryDto dto);

    //取消卖家与合作商的关联；清空买家注册码
    int updateCompanyRegister(PartnerDelCompanyDto dto);

    /**
     * @description: 合作商被邀请
     * @author kyyang
     * @date 2021/8/14 15:32
     * @version 1.0
     */
    void partnerInviter(PartnerDto dto);

    /**
     * 为合作商分配卖家
     * @param dto
     * @return
     */
    Integer allocationSupplier(AllocationSupplierDto dto);
}
